package com.wss.module.main.ui.page;

import com.wss.common.base.BaseActionBarAbility;
import com.wss.common.base.mvp.BasePresenter;
import com.wss.module.main.ResourceTable;
import com.wss.module.main.ui.page.adapter.SlewedAdapter;
import ohos.aafwk.content.Intent;
import ohos.agp.components.ListContainer;

import java.util.ArrayList;
import java.util.List;

public class SlewedAbility extends BaseActionBarAbility {

    ListContainer listContainer;

    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        initView();
    }

    @Override
    protected BasePresenter createPresenter() {
        return null;
    }

    private void initView() {
        setCenterText("侧滑菜单");

        listContainer = (ListContainer) findComponentById(ResourceTable.Id_list_container);
        List<String> dataList = new ArrayList<>();
        for (int i = 0; i < 15; i++) {
            dataList.add("这是Item" + i);
        }
        listContainer.setItemProvider(new SlewedAdapter(this, dataList));
    }

    @Override
    protected int getLayoutId() {
        return ResourceTable.Layout_ability_slewed;
    }

}
